﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="IVirtualPathProvider.cs" company="">
//   
// </copyright>
// <summary>
//   The VirtualPathProvider interface.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Skymate.Core.IO.VirtualPath
{
    using System;
    using System.Collections.Generic;
    using System.IO;

    /// <summary>
    /// The VirtualPathProvider interface.
    /// </summary>
    public interface IVirtualPathProvider
    {
        /// <summary>
        /// The combine.
        /// </summary>
        /// <param name="paths">
        /// The paths.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        string Combine(params string[] paths);

        /// <summary>
        /// The to app relative.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        string ToAppRelative(string virtualPath);

        /// <summary>
        /// The map path.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        string MapPath(string virtualPath);

        /// <summary>
        /// The normalize.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        string Normalize(string virtualPath);

        /// <summary>
        /// The file exists.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        bool FileExists(string virtualPath);

        /// <summary>
        /// The try file exists.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        bool TryFileExists(string virtualPath);

        /// <summary>
        /// The open file.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <returns>
        /// The <see cref="Stream"/>.
        /// </returns>
        Stream OpenFile(string virtualPath);

        /// <summary>
        /// The create text.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <returns>
        /// The <see cref="StreamWriter"/>.
        /// </returns>
        StreamWriter CreateText(string virtualPath);

        /// <summary>
        /// The create file.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <returns>
        /// The <see cref="Stream"/>.
        /// </returns>
        Stream CreateFile(string virtualPath);

        /// <summary>
        /// The get file last write time utc.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <returns>
        /// The <see cref="DateTime"/>.
        /// </returns>
        DateTime GetFileLastWriteTimeUtc(string virtualPath);

        /// <summary>
        /// The get file hash.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        string GetFileHash(string virtualPath);

        /// <summary>
        /// The get file hash.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <param name="dependencies">
        /// The dependencies.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        string GetFileHash(string virtualPath, IEnumerable<string> dependencies);

        /// <summary>
        /// The delete file.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        void DeleteFile(string virtualPath);

        /// <summary>
        /// The directory exists.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <returns>
        /// The <see cref="bool"/>.
        /// </returns>
        bool DirectoryExists(string virtualPath);

        /// <summary>
        /// The create directory.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        void CreateDirectory(string virtualPath);

        /// <summary>
        /// The get directory name.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        /// <returns>
        /// The <see cref="string"/>.
        /// </returns>
        string GetDirectoryName(string virtualPath);

        /// <summary>
        /// The delete directory.
        /// </summary>
        /// <param name="virtualPath">
        /// The virtual path.
        /// </param>
        void DeleteDirectory(string virtualPath);

        /// <summary>
        /// The list files.
        /// </summary>
        /// <param name="path">
        /// The path.
        /// </param>
        /// <returns>
        /// The <see cref="IEnumerable"/>.
        /// </returns>
        IEnumerable<string> ListFiles(string path);

        /// <summary>
        /// The list directories.
        /// </summary>
        /// <param name="path">
        /// The path.
        /// </param>
        /// <returns>
        /// The <see cref="IEnumerable"/>.
        /// </returns>
        IEnumerable<string> ListDirectories(string path);
    }
}